package com.caolei1992.web.controller.system;


import com.caolei1992.api.business.system.service.IUserService;
import com.caolei1992.web.controller.BaseController;
import com.caolei1992.web.vo.AjaxResult;
import io.swagger.annotations.ApiOperation;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 系統用戶表 前端控制器
 * </p>
 *
 * @author caolei
 * @since 2019-12-04
 */
@RestController
@RequestMapping("/api/user")
public class UserController extends BaseController {
    @Reference
    private IUserService userService;

    @ApiOperation(value = "根据用户id获取用户数据")
    @RequestMapping("findById")
    public AjaxResult findById() {
        return AjaxResult.success(userService.findById("1"));
    }

    @ApiOperation(value = "根据用户id删除用户数据")
    @RequestMapping("update")
    public AjaxResult update() {
        return AjaxResult.success(userService.update(userService.findById("1").setPhone("323")));
    }

    @ApiOperation(value = "根据用户id删除用户数据")
    @RequestMapping("deleteById")
    public AjaxResult deleteById() {
        return AjaxResult.success(userService.deleteById("1"));
    }
}

